package top.lishuoboy.javaweb.a06servlet; /**
 * @author lishuoboy
 * @date 2021-12-29 16:19
 */

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 乱码解决  https://blog.csdn.net/lishuoboy/article/details/122219343
 */
@WebServlet(name = "A01Servlet", value = "/A01Servlet")
public class A01Servlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String name = req.getParameter("name");
        System.out.println("name=" + name);
        resp.getWriter().println("name=硕");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        String name = req.getParameter("name");
        System.out.println("name=" + name);
        resp.getWriter().println("name=硕");
    }
}
